Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci[minor]: Add GitHub action to check broken links #403

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

isahers1
Copy link
Contributor

No description provided.

@isahers1 isahers1 marked this pull request as draft August 28, 2024 00:47
@@ -0,0 +1,4 @@
{
"aliveStatusCodes": [200, 206, 402],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to do ranges? We prob want all 200's, all 300's, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my brief chat-gpt research it's not easily doable programatically. I just copied this from the main langgraph one so I assume someone smarter than me had a good reason for selecting these codes but idk

.github/workflows/link_check.yml Outdated Show resolved Hide resolved
Comment on lines 3 to 12
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the code below, it looks like you only want .ipynb files, in that case do this

Suggested change
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
on:
push:
branches: ["main"]
pull_request:
paths:
- '**.ipynb'
workflow_dispatch:

and no need for scheduling, just have it run in PRs and on commits to main

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, unless this is because we want to have a recurring check. Prob makes sense. In that case ya keep the scheduling.

run: |
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ] || ([ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]); then
echo "Running link check on all notebooks in examples directory..."
yarn run pytest -v --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*" --check-links examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where the pytest yarn script is coming from. Maybe you forgot to commit a new dependency you added?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, is this --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" saying don't check langsmith links? If so, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

langsmith links stuff was copied over, not sure why but assume there was a reason. tried to fix the pytest stuff in next push

Comment on lines 53 to 54
run: |
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ] || ([ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]); then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prob dont need this since we have the condition at the top which will only run this on a pr push, push to main, workflow dispatch, or scheduling

@bracesproul bracesproul changed the title doc links ci[minor]: Add GitHub action to check broken links Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants